package LeetcodeTop100;

/**
 * @author zerorain
 * @date 2022/06/30 19:27
 **/
//两数之和
public class Num1 {
    public int[] twoSum(int[] nums, int target) {
                int n = nums.length;
                for (int i = 0; i < n; ++i) {
                    for (int j = i + 1; j < n; ++j) {
                        if (nums[i] + nums[j] == target) {
                            return new int[]{i, j};
                        }
                    }
                }
                return new int[0];
}
}